package com.example.guiguihomemedical.controller;

import com.example.guiguihomemedical.common.Result;
import com.example.guiguihomemedical.entity.dto.HealthRecordTotal;
import com.example.guiguihomemedical.service.HealthRecordTotalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("healthRecord")
public class healthRecordController {
    @Autowired
    private HealthRecordTotalService healthRecordTotalService;
    @GetMapping("/{idcard}")
    public Result gethealthRecordTotal(@PathVariable String idcard){
        HealthRecordTotal healthRecordTotal= healthRecordTotalService.gethealthRecordTotal(idcard);
        return Result.success(healthRecordTotal);
    }
    @PostMapping("/addHealthRecordTotal")
    public Result addaddhealthRecordTotal(@RequestBody HealthRecordTotal healthRecordTotal){
        healthRecordTotalService.addPersonalInfo(healthRecordTotal);
        return Result.success(healthRecordTotal);
    }
}
